// File BaseGameEntity.h
//
// Purpose: Contains the definition of the CBaseGameEntity class
//
// Author : Bryson King (edited)
// Original Code Provided by: Mat Buckland 2002 (fup@ai-junkie.com)
// Date : 18 March 2013
// --------------------------------------------------------------
#ifndef BASEGAMEENTITY_H
#define BASEGAMEENTITY_H

#define DEBUG_SECTION
#include <string>
#include "Telegram.h"
#include "IPerson.h"

class CBaseGameEntity
{
public:
	//base constructor
	CBaseGameEntity(int id);
	//virtual destructor
	virtual ~CBaseGameEntity(void);
	//all entities must implement an update function
	virtual void  Update()=0;

	//all entities can communicate using messages. They are sent
	//using the MessageDispatcher singleton class
	virtual bool  HandleMessage(const Telegram& msg)=0;

	int ID()const{return m_ID;}  

private:
	//every entity must have a unique identifying number
	int m_ID;

	//this is the next valid ID. Each time a CBaseGameEntity is instantiated
	//this value is updated
	static int m_iNextValidID;

	//this must be called within the constructor to make sure the ID is set
	//correctly. It verifies that the value passed to the method is greater
	//or equal to the next valid ID, before setting the ID and incrementing
	//the next valid ID
	void SetID(int val);
};

#endif